<%-- 
    Document   : consultado
    Created on : 21/03/2012, 07:52:45 PM
    Author     : Gimbet
--%>
<%@page import="clases.Columna"%>
<%@page import="clases.Reportable"%>
<%@page import="java.util.ArrayList"%>
<%@page import="clases.Reporte"%>
<%@page import="clases.Matriz"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
  <% ArrayList<Reportable> reportables  = ((Reporte) request.getAttribute("reporte")).getReporte();
        System.out.println(String.valueOf(((Matriz)(reportables.get(0))).isEjec()));%>
      <tiles:insert definition="mensaje"></tiles:insert>
      <logic:present name="reporte" property="idreporte">
          
          <h1><bean:write name="reporte" property="nombre"></bean:write></h1>

          <p>  <strong>Nota: </strong> Se recomienda que a partir de 7 columnas o m&aacute;s
              las matrices se descarguen &uacute;nicamente en formato <b> EXCEL </b> para 
              facilitar su lectura <p>
               <logic:iterate name="reporte" property="reporte" id="rep" indexId="repIndex">
                   <h3>    <bean:write name="rep" property="nombre"></bean:write> </h3>
                   <br>
                <% Integer countRep = (Integer) pageContext.getAttribute("repIndex");%>
                <bean:define id="plan" value="<%=String.valueOf(((Matriz)(reportables.get(countRep))).isPlan())%>"></bean:define>
                <bean:define id="ajuste" value="<%=String.valueOf(((Matriz)(reportables.get(countRep))).isAjuste())%>"></bean:define>
                <bean:define id="ejec" value="<%=String.valueOf(((Matriz)(reportables.get(countRep))).isEjec())%>"></bean:define>
                <% request.setAttribute("Matriz",(Matriz)(reportables.get(countRep)));%>
                <br>
                <logic:equal name="plan" value="true"> 
                    <tiles:insert definition="vistas.admin.matrices.matriz" flush="false"></tiles:insert>
                </logic:equal>
                <br> 
                 <logic:equal name="ajuste" value="true">
                     <tiles:insert definition="vistas.admin.matrices.matriz" flush="false"></tiles:insert>
                </logic:equal>
                <br>
                <logic:equal name="ejec" value="true">
                    <tiles:insert definition="vistas.admin.matrices.matriz" flush="false"></tiles:insert>
                </logic:equal>

          </logic:iterate>
                <br><br>
            <div class="buttons">
                <html:form action="/descargarReporte.do" onsubmit="return this">
                    <html:hidden name="reporte" property="idreporte"></html:hidden>
                <button type="submit" class="regular" style="margin-left: 3%; margin-top: 3%;">
                    <img src="interfaz/images/pdf.png" alt=""/>
                   Descargar en PDF
                </button>
                </html:form>
                <html:form action="/descargarCVS?method=execute" onsubmit="return this">
                     <html:hidden name="reporte" property="idreporte"></html:hidden>
                <button type="submit" class="regular" style="margin-left: 3%; margin-top: 3%;">
                    <img src="interfaz/images/excel.png" alt=""/>
                   Descargar en Excel
                </button>
                </html:form>
            </div>
      </logic:present>
</html>
